package T4.EjemplosDelSwing.ejemplosgui;

import javax.swing.*;
import java.awt.*;

class Frame7 extends JFrame {

    public Frame7() {
        setSize(350, 150);
        Container container = this.getContentPane();
        GridLayout grid = new GridLayout(3, 2, 5, 5);
        container.setLayout(grid);

        for (int i = 0; i < 6; i++) {
            container.add(new JButton("Button" + (i + 1)));
        }
    }
}

public class Ejemplo7 {

    public static void main(String[] args) {
        Frame7 frame = new Frame7();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
    }
}
